<h:panelGroup xmlns:h='http://java.sun.com/jsf/html'
              xmlns:p='http://primefaces.org/ui'
              xmlns:z='http://savanti.com.bo/ui'
              xmlns:s='http://savanti.com.bo/ui-simple'
              xmlns:x='http://java.sun.com/jsf/composite/ui/component' styleClass='ITVentaPos' id='ITVentaPos'><p:growl id='growl'/>

<z:focus focus='#{ITVentaPos.focus}'/>

<z:beanMenubar bean='#{ITVentaPos}' title='VENTA POS #{ITVentaPos.entity.id}' print='report'/>


<p:overlayPanel for='btnPrint'>

  <p:commandButton icon='ui-icon-trash' title='Limpiar Impresora' update='@(.ITVentaPos)' actionListener='#{ITVentaPos.uiCleanPrint}' style='border:none;float:right'/>

  <h:panelGrid id='report'>

  <h:panelGrid  style='text-align:center;white-space:pre;font-size:12px;font-family:Consolas' rendered='#{not ITVentaPos.nota and ITVentaPos.report != null}'>

  <h:outputText value='#{ITVentaPos.report}'/>

  <p:barcode value='#{ITVentaPos.barcode}' type='qr' width='200' height='200'/>

  <h:outputText value='ESTA FACTURA CONTRIBUYE AL DESARROLLO'/>

  <h:outputText value='DEL PAIS. EL USO ILICITO DE ESTA SERA'/>

  <h:outputText value='SANCIONADO DE ACUERDO A LEY'/>

  </h:panelGrid>

</h:panelGrid></p:overlayPanel>


<h:panelGrid columns='1' width='100%' rendered='#{ITVentaPos.form}'>

<h:panelGrid id='bean' columns='2' styleClass='bean align-top'>

  <x:beanPanel id='hd' bean='#{ITVentaPos}' title='Cabecera' cellpadding='0'>

  <h:panelGrid columns='1' cellpadding='9'>

  <x:fieldC b='#{bean}' t='Nota' v='#{ITVentaPos.nota}'/>

  <x:fieldA b='#{bean}' t='NIT / CI' w='95px'  v='#{ITVentaPos.nit}' l='buscarNIT' id='nitId' rendered='#{not ITVentaPos.nota}'/>

  <x:fieldI b='#{bean}' t='Nombre'   w='120px' v='#{ITVentaPos.razon}' onkeydown='tab()' id='nombreId'/>

  </h:panelGrid>


  <h:panelGrid columns='1' cellpadding='9'>

  <x:fieldN b='#{bean}' t='Total'  wT='45px' w='60px'  v='#{ITVentaPos.entity.total}' style='background:#ffcc25;font-size:115%'/>

  <x:fieldN b='#{bean}' t='Vuelto' wT='45px' w='60px'  v='#{ITVentaPos.entity.vuelto}' style='background:#ffef1e;font-size:115%'/>

  <x:fieldA b='#{bean}' t='Pagado' wT='45px' w='50px'  v='#{ITVentaPos.entity.pagado}' l='calVuelto' u=':#{formId}:bean' onclick="fc('btnSave')"/>

  </h:panelGrid>

  </x:beanPanel>


  <x:beanPanel id='ps' bean='#{ITVentaPos}' title='Posicion' cellpadding='4' style='min-width: 500px'>

  <h:panelGrid columns='1' cellpadding='8' style='margin-right: 2px'>

  <x:fieldAL t='Almacen' v='#{bean.almacen.nombre}' s='#{bean.detalle.stock}'/>

  <x:fieldM b='#{bean}' t='Producto' v='#{bean.detalle.material}' x='#{x}' id='materialId'/>

  <x:fieldA b='#{bean}' t='Cantidad' v='#{bean.detalle.cantidad}' w='50px' l='detailAdd' id='cantidadId'/>

  </h:panelGrid>

  <x:materialImage c='#{bean.detalle.material.id}' t='Bs. ' v='#{bean.detalle.precio}' r='2'/>

  </x:beanPanel>

</h:panelGrid>


<x:materialTable bean='#{ITVentaPos}' ls='#{ITVentaPos.entity.lsVentaDetalle}'>

<s:columnT t='Codigo'    v='#{x.material.codigo}' w='55px'/>

<s:columnT t='Nombre'    v='#{x.material.nombre}'/>

<s:columnN t='Cantidad'  v='#{x.cantidad}'        w='75px'/>

<s:columnN t='Precio'    v='#{x.precio}'          w='75px'/>

<s:columnN t='Importe'   v='#{x.importe}'         w='75px'/>

<s:columnN t='Descuento' v='#{x.descuento}'       w='75px'/>

<s:columnN t='Total'     v='#{x.total}'           w='75px'/>

</x:materialTable>

</h:panelGrid>

<h:panelGroup rendered='#{ITVentaPos.nota and ITVentaPos.report != null}'>

<div style='text-align: center'>

<OBJECT classid='clsid:8AD9C840-044E-11D1-B3E9-00805F499D93' width='350' height='16'

        codebase= 'http://java.sun.com/products/plugin/autodl/jinstall-1_4-windows-i586.cab#Version=1,4'>

        <param name='CODE' value='eva.savant.core.printer.PrinterApplet'/>

        <param name='ARCHIVE' value='../resources/applet/printerApplet.jar'/>

        <param name='TxtPrint' value='#{ITVentaPos.report}'/>

        <COMMENT>

        <embed TxtPrint='#{ITVentaPos.report}' type='application/x-java-applet' width='350' height='16'

               archive='../resources/applet/printerApplet.jar' code='eva.savant.core.printer.PrinterApplet.class'>

        <noembed>No se ecuentra instalado Java Standard Edition, es requerido ...!!</noembed>

        </embed>

        </COMMENT>


<p:commandButton icon='ui-icon-trash' title='Limpiar Impresora' update='@(.ITVentaPos)' actionListener='#{ITVentaPos.uiCleanPrint}' style='border:none'/>

</OBJECT>

</div>

</h:panelGroup>

</h:panelGroup>